package yyee.llee.mmee.base_api_net;

import android.content.Context;
import android.os.Build;
import android.util.Log;
import yyee.llee.mmee.base_api_net.utils.AesUtil;
import yyee.llee.mmee.base_api_net.utils.GsonUtils;
import yyee.llee.mmee.base_api_net.utils.MD5Util;
import yyee.llee.mmee.base_api_net.utils.URLEncodedUtils;
import yyee.llee.mmee.common.BuildConfig;
import yyee.llee.mmee.common.global.Env;
import yyee.llee.mmee.pl190.host668.StrongContext;
import yyee.llee.mmee.pl190.host668.DeviceUtils;
import yyee.llee.mmee.pl190.host668.GlobalConfig;
import java.util.Map;
import java.util.TreeMap;

public final class BasicParamsTools {

    private static final String TAG = "NetManager";

    private static final String PARAM_OS_BOARD = "os_board";

    private static final String PARAM_OS_SDK_INT = "os_sdk_version";

    private static final String PARAM_DEVICE_MAC = "dmac";

    private static final String PARAM_DEVICE_IMSI = "dimsi";

    private static final String PARAM_DEVICE_SIM_SERIAL_NUMBER = "simsn";

    private static final String PARAM_APPID = "appid";

    private static final String PARAM_TIMESTAMP = "timestamp";

    private static final String PARAM_VERSION = "version";

    private static final String PARAM_DATA = "data";

    private static final String PARAM_SIGN = "sign";

    private static final String PARAM_DEVICE_IMEI = "imei";

    private static final String PARAM_DEVICE_OAID = "oaid";

    private static final String PARAM_DEVICE_ANDROID_ID = "androidid";

    private static final String PARAM_IP = "ip";

    private static final String PARAM_SSID = "ssid";

    private static final String PARAM_BSSID = "bssid";

    private static final String PARAM_MODEL = "model";

    private static final String PARAM_APP_LIST = "applist";

    private static final String PARAM_VENDOR = "vendor";

    private static final String PARAM_CITY = "city";

    private static final String PARAM_KEY = "key";

    public static final String PARAM_CHANNERL = "channel";

    public static final String ISAUTOLANCH = "isautolanch";

    private static final String sAppid = Env.isDebug ? Env.DEBUG_APPID : Env.RELEASE_APPID;

    // 归因请求的type
    public static final String REQ_TYPE = "req_type";

    public final void buildParams(Context context, Map<String, String> params, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
        int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
        for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
            int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
            for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                    minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                }
            }
            if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
            }
        }
        params.put(PARAM_APPID, sAppid);
        params.put(PARAM_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
        // 需要 工程统一配置下 version 暂时先写死 3
        String versionName = Env.VERSION;
        Log.d("versionName", "" + versionName);
        params.put(PARAM_VERSION, versionName);
        params.put(PARAM_DATA, getCryptedParams(buildCommonParams(context, publicParams)));
        String paramsString = URLEncodedUtils.format(params, URLEncodedUtils.DEFAULT_ENCODING);
        paramsString = paramsString + "&key=" + AesUtil.sSecretKey.substring(AesUtil.sSecretKey.length() - 16);
        Log.d(TAG, paramsString);
        String sign = MD5Util.getMD5code(paramsString).toUpperCase();
        params.put(PARAM_SIGN, sign);
    }

    public final void buildSelfStartParams(Context context, Map<String, String> params, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
        int keydasopuerqnfdazcveq = 4;
        int lowupoeqfda7073fdal = 0;
        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
        int middledaiueprnvznfewqip = 0;
        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
            int adfajpouqregjbdipug = 1;
        } else {
            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                    // 比关键字大则关键字在左区域
                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                    // 比关键字小则关键字在右区域
                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                } else {
                }
            }
        }
        params.put(PARAM_APPID, sAppid);
        params.put(PARAM_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
        // 需要 工程统一配置下 version 暂时先写死 3
        String versionName = Env.VERSION;
        Log.d("versionName", "" + versionName);
        params.put(PARAM_VERSION, versionName);
        params.put(PARAM_DATA, getCryptedParams(buildStartParams(context, publicParams)));
        String paramsString = URLEncodedUtils.format(params, URLEncodedUtils.DEFAULT_ENCODING);
        paramsString = paramsString + "&key=" + AesUtil.sSecretKey.substring(AesUtil.sSecretKey.length() - 16);
        Log.d(TAG, paramsString);
        String sign = MD5Util.getMD5code(paramsString).toUpperCase();
        params.put(PARAM_SIGN, sign);
    }

    public final void buildADParams(Context context, Map<String, String> params, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        params.put(PARAM_APPID, sAppid);
        params.put(PARAM_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
        // 需要 工程统一配置下 version 暂时先写死 3
        String versionName = Env.VERSION;
        Log.d("versionName", "" + versionName);
        params.put(PARAM_VERSION, versionName);
        publicParams.put("imei", DeviceUtils.getPhoneImei(StrongContext.getApplication()));
        publicParams.put("oaid", DeviceUtils.getOaId());
        publicParams.put("uumid", DeviceUtils.getUmId(context));
        publicParams.put(PARAM_OS_SDK_INT, "android_" + Build.VERSION.SDK_INT);
        publicParams.put("androidid", DeviceUtils.getAndroidId(StrongContext.getApplication()));
        publicParams.put("model", Build.MODEL);
        publicParams.put("vendor", Build.MANUFACTURER);
        publicParams.put("channel", GlobalConfig.CHANNEL);
        params.put(PARAM_DATA, getCryptedParams(publicParams));
        String paramsString = URLEncodedUtils.format(params, URLEncodedUtils.DEFAULT_ENCODING);
        paramsString = paramsString + "&key=" + AesUtil.sSecretKey.substring(AesUtil.sSecretKey.length() - 16);
        Log.d(TAG, paramsString);
        String sign = MD5Util.getMD5code(paramsString).toUpperCase();
        params.put(PARAM_SIGN, sign);
    }

    public final Map<String, Object> buildCommonParams(Context context, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
        int keydasopuerqnfdazcveq = 4;
        int lowupoeqfda7073fdal = 0;
        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
        int middledaiueprnvznfewqip = 0;
        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
            int adfajpouqregjbdipug = 1;
        } else {
            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                    // 比关键字大则关键字在左区域
                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                    // 比关键字小则关键字在右区域
                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                } else {
                }
            }
        }
        Map<String, Object> params = new TreeMap<>();
        params.put(PARAM_DEVICE_IMEI, DeviceUtils.getPhoneImei(context));
        // params.put(PARAM_DEVICE_OAID, String.valueOf(DeviceUtils.getOaId(context)));
        params.put(PARAM_DEVICE_ANDROID_ID, String.valueOf(DeviceUtils.getAndroidId(context)));
        // params.put(PARAM_BSSID, "");
        params.put(PARAM_MODEL, Build.MODEL);
        // params.put(PARAM_APP_LIST, "");
        params.put(PARAM_VENDOR, Build.MANUFACTURER);
        params.put(PARAM_OS_BOARD, Build.BOARD);
        params.put("oaid", DeviceUtils.getOaId());
        params.put(PARAM_DEVICE_IMSI, DeviceUtils.getPhoneImsi(context));
        params.put(PARAM_DEVICE_MAC, DeviceUtils.getLocalMacAddress(context));
        // params.put(PARAM_DEVICE_SIM_SERIAL_NUMBER, DeviceUtils.getSimSerialNumber(context));
        params.put(PARAM_OS_SDK_INT, "android_" + Build.VERSION.SDK_INT);
        params.put("uumid", DeviceUtils.getUmId(context));
        params.put("is_adb", DeviceUtils.isAdb());
        params.put("http_ua", DeviceUtils.getSysUA());
        params.put("web_ua", DeviceUtils.getWebUA());
        publicParams.put("channel", GlobalConfig.CHANNEL);
        params.putAll(publicParams);
        Log.d("lanchParams", " build common " + GsonUtils.toJson(params));
        return params;
    }

    public final Map<String, Object> buildStartParams(Context context, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        Map<String, Object> params = new TreeMap<>();
        params.put(PARAM_DEVICE_ANDROID_ID, String.valueOf(DeviceUtils.getAndroidId(context)));
        params.put("oaid", DeviceUtils.getOaId());
        params.put(PARAM_VENDOR, Build.MANUFACTURER);
        params.put(PARAM_MODEL, Build.MODEL);
        params.put(PARAM_OS_SDK_INT, "android_" + Build.VERSION.SDK_INT);
        params.put("uumid", DeviceUtils.getUmId(context));
        DeviceUtils.getFirstInstallTime(params);
        publicParams.put("channel", GlobalConfig.CHANNEL);
        params.putAll(publicParams);
        Log.d("lanchParams", " build Params " + GsonUtils.toJson(params));
        return params;
    }

    /**
     * 将URI参数转为加密参数
     *
     * @param params
     * @return
     */
    public static final String getCryptedParams(Map<String, Object> params) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        String query = GsonUtils.toJson(params);
        // String cryptedParams = AesUtil.encryptAES(query.toString());
        String cryptedParams = AesUtil.encrypt(query.toString());
        if (BuildConfig.DEBUG) {
            Log.d(TAG, "uncrypted params: " + query);
            Log.d(TAG, "crypted: " + cryptedParams);
        }
        return cryptedParams;
    }

    public void buildLiveParams(Context context, TreeMap<String, String> params, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        params.put(PARAM_APPID, sAppid);
        params.put(PARAM_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
        // 需要 工程统一配置下 version 暂时先写死 3
        String versionName = Env.VERSION;
        Log.d("versionName", "" + versionName);
        params.put(PARAM_VERSION, versionName);
        publicParams.put("imei", DeviceUtils.getPhoneImei(StrongContext.getApplication()));
        publicParams.put("oaid", DeviceUtils.getOaId());
        publicParams.put("uumid", DeviceUtils.getUmId(context));
        publicParams.put("androidid", DeviceUtils.getAndroidId(StrongContext.getApplication()));
        publicParams.put("model", Build.MODEL);
        publicParams.put("vendor", Build.MANUFACTURER);
        publicParams.put("channel", GlobalConfig.CHANNEL);
        params.put(PARAM_DATA, getCryptedParams(publicParams));
        Log.d(TAG, "buildLiveParams: " + GsonUtils.toJson(params));
        String paramsString = URLEncodedUtils.format(params, URLEncodedUtils.DEFAULT_ENCODING);
        paramsString = paramsString + "&key=" + AesUtil.sSecretKey.substring(AesUtil.sSecretKey.length() - 16);
        Log.d(TAG, paramsString);
        String sign = MD5Util.getMD5code(paramsString).toUpperCase();
        params.put(PARAM_SIGN, sign);
    }

    public void buildPolicyParams(TreeMap<String, String> params, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        params.put(PARAM_APPID, sAppid);
        params.put(PARAM_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
        String versionName = Env.VERSION;
        Log.d("versionName", "" + versionName);
        params.put(PARAM_VERSION, versionName);
        publicParams.put("channel", GlobalConfig.CHANNEL);
        params.put(PARAM_DATA, getCryptedParams(publicParams));
        String paramsString = URLEncodedUtils.format(params, URLEncodedUtils.DEFAULT_ENCODING);
        paramsString = paramsString + "&key=" + AesUtil.sSecretKey.substring(AesUtil.sSecretKey.length() - 16);
        Log.d(TAG, paramsString);
        String sign = MD5Util.getMD5code(paramsString).toUpperCase();
        params.put(PARAM_SIGN, sign);
    }

    public void buildSHParams(Context context, TreeMap<String, String> params, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        params.put(PARAM_APPID, sAppid);
        params.put(PARAM_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
        // 需要 工程统一配置下 version 暂时先写死 3
        String versionName = Env.VERSION;
        Log.d("versionName", "" + versionName);
        params.put(PARAM_VERSION, versionName);
        params.put(PARAM_DATA, getCryptedParams(buildSHCommonParams(context, publicParams)));
        String paramsString = URLEncodedUtils.format(params, URLEncodedUtils.DEFAULT_ENCODING);
        paramsString = paramsString + "&key=" + AesUtil.sSecretKey.substring(AesUtil.sSecretKey.length() - 16);
        Log.d(TAG, paramsString);
        String sign = MD5Util.getMD5code(paramsString).toUpperCase();
        params.put(PARAM_SIGN, sign);
    }

    public final Map<String, Object> buildSHCommonParams(Context context, Map<String, Object> publicParams) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        Map<String, Object> params = new TreeMap<>();
        params.put(PARAM_MODEL, Build.MODEL);
        params.put(PARAM_VENDOR, Build.MANUFACTURER);
        params.put(PARAM_OS_BOARD, Build.BOARD);
        // params.put(PARAM_DEVICE_SIM_SERIAL_NUMBER, DeviceUtils.getSimSerialNumber(context));
        params.put("uumid", DeviceUtils.getUmId(context));
        params.put(PARAM_OS_SDK_INT, "android_" + Build.VERSION.SDK_INT);
        publicParams.put("channel", GlobalConfig.CHANNEL);
        params.putAll(publicParams);
        Log.d(TAG, " buildSHCommonParams---end-- " + GsonUtils.toJson(params));
        return params;
    }

    public final static TreeMap encode(Map<String, Object> params) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
        int keydasopuerqnfdazcveq = 4;
        int lowupoeqfda7073fdal = 0;
        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
        int middledaiueprnvznfewqip = 0;
        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
            int adfajpouqregjbdipug = 1;
        } else {
            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                    // 比关键字大则关键字在左区域
                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                    // 比关键字小则关键字在右区域
                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                } else {
                }
            }
        }
        TreeMap<String, String> outPrarams = new TreeMap<>();
        outPrarams.put(PARAM_VERSION, Env.VERSION);
        outPrarams.put(PARAM_APPID, sAppid);
        outPrarams.put(PARAM_TIMESTAMP, String.valueOf(System.currentTimeMillis() / 1000));
        outPrarams.put(PARAM_DATA, getCryptedParams(params));
        String paramsString = URLEncodedUtils.format(outPrarams, URLEncodedUtils.DEFAULT_ENCODING);
        paramsString = paramsString + "&key=" + AesUtil.sSecretKey.substring(AesUtil.sSecretKey.length() - 16);
        String sign = MD5Util.getMD5code(paramsString).toUpperCase();
        outPrarams.put(PARAM_SIGN, sign);
        return outPrarams;
    }
}
